Build Android with Gradle (Signing)

Signing Configurations

  • A keystore
  • A keystore password
  • A key alias name
  • A key password
  • The store type

debug keystore 預設位於 $HOME/.android/debug.keystore
debug Build Type會自動選 debug keystore

Signing example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
android {
signingConfigs {
debug {
storeFile file("debug.keystore")
}

alphaConfig {
storeFile file("alpha.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}

buildTypes {
alpha {
debuggable true
jniDebuggable true
signingConfig signingConfigs.alphaConfig
}
}
}